package com.bytenebula.entity;

import com.bytenebula.entity.core.BnEntity;
import com.mybatisflex.annotation.RelationOneToOne;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.sql.Timestamp;

import java.io.Serial;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.EqualsAndHashCode;

/**
 *  实体类。
 *
 * @author patrick
 * @since 2024-10-30
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table(value = "bn_user_account", dataSource = "bytenebula")
public class BnAccount extends BnEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    private Integer userId;
    private String userName;
    private String password;
    private Timestamp lastLoginedTime;

    @RelationOneToOne(selfField = "userId", targetTable = "bn_user", targetField = "id")
    private BnUser user;
}
